"""
数据容器字典的定义
"""

# 定义字典
my_dict1 = {'小明': 100, "小红": 88, "张三": 99}
# 定义空字典
my_dict2 = {}
my_dict3 = dict()
print(f"字典1的内容是：{my_dict1},类型：{type(my_dict1)}")
print(f"字典2的内容是：{my_dict2},类型：{type(my_dict2)}")
print(f"字典3的内容是：{my_dict3},类型：{type(my_dict3)}")
# 定义重复Key的字典
my_dict1 = {'小明': 100, "小明": 22, "小红": 88, "张三": 99}
print(f"重复key的字典的内容是：{my_dict1}")

# 从字典中基于Key获取Value
my_dict1 = {'小明': 100, "小红": 88, "张三": 99}
score = my_dict1['小明']
print(f"小明的分数是：{score}")

# 定义嵌套字典
stu_score_dict = {
    "小明": {
        "语文": 100,
        "数学": 100,
        "英语": 100
    },
    "小红": {
        "语文": 99,
        "数学": 88,
        "英语": 77
    },
    "小张": {
        "语文": 66,
        "数学": 99,
        "英语": 88
    }
}
print(f"学生的考试信息是：{stu_score_dict}")

# 从嵌套字典中获取数据
# 看小明的成绩信息
score = stu_score_dict['小明']["语文"]
print(f"小明的语文分数是：{score}")
score = stu_score_dict['小红']["英语"]
print(f"小红的英语的分数是：{score}")